home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / General App Samples / QDGX Scrolling ƒ / QDGX Scrolling main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-20  |  2.4 KB  |  100 lines  |  [TEXT/MMCC]

  1. /**
  2.  --        File:        GX Scrolling (main).h
  3.  --
  4.  --        Comments:    This header file contains the prototypes, constants, and type definitions
  5.  --                    used by "GX Scrolling (main).c" file.
  6.  --
  7.  --        Version:    1.0     1/93      
  8.  --                            => added general GX support & scrolling
  9.  --
  10.  --
  11.  --        Components:    GX Scrolling (main).c
  12.  --                    GX Scrolling (main).h
  13.  --                    GX Scrolling Controls.c
  14.  --                    GX Scrolling Controls.h
  15.  --                    GX Scrolling (main).π.rsrc
  16.  --
  17.  --
  18.  --        Notes:        1) Print this file in landscape for the best results
  19.  --                    2) If you are using THINK C v5.x, I have added markers to navigate the 
  20.  --                       code.
  21.  --                    3) This code was adapted and simplyified from the "DTS AE Skeleton" sample.
  22.  --
  23.  --        Author:        Pete "Luke" Alexander
  24.  --                    Developer Technical Support
  25.  --                    AppleLink: DEVSUPPORT
  26.  --
  27.  --        
  28.  --        ©1992 - 1993  Apple Computer, Inc. 
  29.  --        All rights reserved.
  30.  --
  31.  **/
  32.  
  33.  
  34. /***** External Prototype (needed in GX Scrolling Controls.c) *****/
  35. extern void DrawWindow(WindowPtr theWindow);
  36.  
  37.  
  38. /***** Type Definitions *****/
  39. typedef struct MyWindowRecord    /* Tack storage onto the end of the WindowRecord */
  40. {
  41.     WindowRecord    window;
  42.     PicHandle        picture;    /* PICT to display in window */
  43.     Rect            documentBoundsRect;    
  44.     Point            origin;        /* location of upper left corner of picture in window (local) */
  45.     ControlHandle    hScrollBar;    /* Handle to horizontal scroll bar */
  46.     ControlHandle    vScrollBar;    /* Handle to vertical scroll bar */
  47. } MyWindowRecord, *MyWindowPeek;
  48.  
  49.  
  50. /***** Constants *****/
  51. enum
  52. {
  53.     kDriverType            = 'DRVR',    /* Resource Types */
  54.     kPictureType        = 'PICT',
  55.     
  56.     kScrollBarWidth        = 16,        /* Constants */
  57.     kMinWindowWidth        = 100,
  58.     kMinWindowHeight    = 75,
  59.     kTitleBarHeight        = 19,
  60.     kNewWindowOffset    = 1+kTitleBarHeight,
  61.     kMinimumDocumentSize = 64,
  62.     
  63.     rMenuBar            = 1000,        /* Menu bar */
  64.     
  65.     mApple                = 1000,        /* Menus */
  66.     iAbout                = 1,
  67.     
  68.     mFile                = 1001,
  69.     iNew                = 1,
  70.     iOpen                = 2,
  71.     iClose                = 3,
  72.     iSave                = 5,
  73.     iSaveAs                = 6,
  74.     iPrintOneCopy        = 8,
  75.     iDocumentSetup        = 9,
  76.     iPageSetup            = 10,
  77.     iPrint                = 11,
  78.     iQuit                = 13,
  79.     
  80.     rAboutBox            = 1000,        /* Alerts */
  81.     rFatalErrorAlert    = 1001,
  82.     rNonFatalErrorAlert    = 1002,
  83.     
  84.     rErrorStrings        = 1000,        /* Errors */
  85.     kNoFileRoutinesErr    = 1,
  86.     kNoAppleEventsErr    = 2,
  87.     kNoMenuBarErr        = 3,
  88.     kOutOfMemoryErr        = 4,
  89.     kCanNotOpenFile        = 5,
  90.     kBadPictFile        = 6,
  91.     kPrintingErr        = 7,
  92.     kAppleEventErr        = 8,
  93.     kAppleEventInitErr    = 9,
  94.     kGotOAPP            = 10,
  95.     kGotODOC            = 11,
  96.     kGotPDOC            = 12,
  97.     kGotQUIT            = 13,
  98.  
  99.     rDocumentWindow        = 1000        /* Windows */
  100. };